<template>
  <div class="member">
    <!-- 返回 -->
    <top-back>
      <template v-slot:back>会员中心</template>
    </top-back>

    <!-- userInfo -->
    <div class="user">
      <div class="user_info">
        <div class="info">
          <img :src="user.headerimg" alt="" />
          <div class="text">
            <div class="top">
              <strong>{{ user.username }}</strong>
              <i>VIP</i>
            </div>
            <p>2029-09-09 到期</p>
          </div>
        </div>
        <span>续费</span>
      </div>
    </div>

    <!-- 会员特权 -->
    <div class="center">
      <p>会员专属特权</p>
      <ul>
        <li v-for="(item, index) in icon_list" :key="index">
          <van-icon
            :name="item.icon"
            class="iconcolor"
            size="1rem"
            color="#d30258"
          />
          <span>{{ item.txt }}</span>
        </li>
      </ul>
    </div>

    <!-- 会员说明 -->
    <div class="tips">
      <p>会员说明</p>
      <ul>
        <li>会员特权简要说明</li>
        <li>会员特权简要说明会员特权简要说明</li>
        <li>会员特权简要说明</li>
        <li>会员特权简要说明会员特权简要说明</li>
      </ul>
    </div>
  </div>
</template>

<script>
import TopBack from '@/components/Mine/TopBack'

export default {
  name: 'MemberView',
  components: {
    TopBack
  },
  data () {
    return {
      user: {},
      icon_list: [
        { txt: '会员特权一', icon: 'fire' },
        { txt: '会员特权二', icon: 'gem' },
        { txt: '会员特权三', icon: 'point-gift' },
        { txt: '会员特权一', icon: 'fire' },
        { txt: '会员特权二', icon: 'gem' },
        { txt: '会员特权三', icon: 'point-gift' }

      ]
    }
  },
  created () {
    this.user = this.$store.getters.user
  }
}
</script>

<style lang="scss" scoped>
.member {
  width: 100vw;
  height: 100vh;
  background-color: #fff;
}
.user_info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 7rem;
  margin: 20px auto 0;
  padding: 0.4rem 0.3rem 0.6rem;
  border-radius: 0.2rem;
  background-color: #000;
  box-sizing: border-box;
  color: #999;
  .info {
    display: flex;
    align-items: center;
    img {
      width: 1.2rem;
      height: 1.2rem;
      border-radius: 50%;
      margin-right: 0.3rem;
    }
    .text {
      display: flex;
      flex-direction: column;
      justify-content: center;
      .top {
        display: flex;
        align-items: center;
      }
      p {
        padding-top: 0.1rem;
        font-size: 0.26rem;
        color: #999;
      }
      strong {
        padding-right: 0.2rem;
        padding-bottom: 0.2rem;
        font-size: 0.32rem;
        color: #fff;
      }
      i {
        width: 0.54rem;
        height: 0.3rem;
        border-radius: 0.15rem;
        background-image: linear-gradient(to right, #8d6b2d, #cdad70);
        text-align: center;
        line-height: 0.3rem;
        font-size: 0.18rem;
        color: #000;
      }
    }
  }
  span {
    font-size: 12px;
    padding: 3px 6px;
    border-radius: 10px;
    border: 1px solid #866425;
    color: #866425;
  }
}

.center {
  width: 7rem;
  margin: 0 auto;
  padding-top: 26px;
  font-size: 14px;
  p {
    color: #333;
  }
  ul {
    display: flex;
    flex-wrap: wrap;
    padding-top: 20px;
    li {
      width: 33%;
      height: 80px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      .van-icon {
        padding-bottom: 10px;
      }
      span {
        font-size: 12px;
      }
    }
  }
}
.tips {
  width: 7rem;
  margin: 0 auto;
  padding-top: 36px;
  font-size: 14px;
  p {
    color: #333;
  }
  ul {
    padding-top: 16px;
    padding-left: 30px;
    list-style-type: disc;
  }
}
</style>
